import heapq
from dataclasses import dataclass, field
from functools import total_ordering

@dataclass
@total_ordering
class Node:
    addr: int = field()
    value: int
    n_addr: int = -1

    def __eq__(self, other):
        return self.value == other.value

    def __lt__(self, other):
        return self.value < other.value


a = [Node(1, 4, 3), Node(1, 3, 3), Node(1, 2, 3)]
print(a[0] > a[1])

heapq.heapify(a)
print(a)
b = heapq.heappop(a)
print(b)
